<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

class Logger {

  protected static $_vars = array();

  public static function write($item) {
    self::$_vars[] = $item;
  }
  
  public static function flush(){
    $str = '';
    foreach(self::$_vars as $item){
      $str .=  $item ."\r";
    }
    if($fp =  fopen(LOG_DIR . date('Y_m_d'). '.txt', 'ab')){
      @fwrite($fp, $str);
      @fclose($fp);
    }    
  }
}